/*
 * Point.h
 *
 *  Created on: 16 mars 2011
 *      Author: seeme
 */

#ifndef POINT_H_
#define POINT_H_

#include "Vect4.h"
#include <iostream>

class Point{

	public:
		float x, y, z;
		float u, v;
		float nx, ny, nz;
		Point(float x, float y, float z, float u, float v, float nx, float ny, float nz):x(x), y(y), z(z), u(u), v(v), nx(nx), ny(ny), nz(nz){};
		Point(float x, float y, float z, float u, float v):x(x), y(y), z(z), u(u), v(v), nx(), ny(), nz(){};
		Point(float x, float y, float z): x(x), y(y), z(z), u(), v(), nx(), ny(), nz(){};
		Point():x(), y(), z(), u(), v(), nx(), ny(), nz(){}
		Point(Vect4<float>vect, float u, float v, Vect4<float> norm): x(vect.x), y(vect.y), z(vect.z), u(u), v(v), nx(norm.x), ny(norm.y), nz(norm.z){};
		Point(Vect4<float>v): x(v.x), y(v.y), z(v.z), u(), v(), nx(), ny(), nz(){};

		friend std::ostream& operator<<(std::ostream& out, const Point& p){
			p.print(out);
			return out;
		}

		virtual void print(std::ostream& o) const {
			o << "Point(" << x << "," << y<< "," << z<<")";
		}

		Point& operator=(const Point& p){
			if(this != &p){
				x = p.x;
				y = p.y;
				z = p.z;
			}
			return *this;
		}
};

template <class T>
bool operator==(const Point& p1, const Point& p2){
	return p1.x == p2.x && p1.y == p2.y && p1.z == p2.z;
}

template <class T>
bool operator!=(const Point& p1, const Point& p2){
	return !(p1.x == p2.x && p1.y == p2.y && p1.z == p2.z);
}
#endif /* POINT_H_ */
